import 'package:flutter/material.dart';
import 'package:wu_you/utils/utils.dart';

class AppBarLeading extends StatelessWidget {
  final Image leading;

  AppBarLeading(this.leading, {Key key}) : super(key: key);
  ///默认 ic_mall_back
  AppBarLeading.leading(String leading, {Key key})
      : leading = Image.asset(Utils.getImgPath(leading),width: 29,height: 29,fit: BoxFit.contain,),
        super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: (){
        Navigator.pop(context);
      },
      child: Center(
        child: leading,
      ),
    );
  }
}
